import React from 'react'
import {Paih} from "../api/index"
class Paihang extends React.Component{
            constructor(){
                super()
                this.state={
                    arr:[]
                }
            }
            componentDidMount(){
                let _this= this
                Paih().then(res=>{
                    // console.log(res);
                    _this.setState({
                        arr:res.data.data
                    })
                })
            }
            shuju(id){
        
                this.props.history.push({ pathname: "/move/xiangqing", state: { id } });
              } 
    render(){
            return(
               <div>
                   <div>
                       <h1>MV排行榜</h1>
                   </div>
                   <ul>
                       <li className="zx_li">内地</li>
                       <li className="zx_li">港台</li>
                       <li className="zx_li">欧美</li>
                       <li className="zx_li">韩国</li>
                       <li className="zx_li">日本</li>
                   </ul>
                   <hr/>
                        <div>
                            <ul>
            {this.state.arr.map((item,id)=>(<li key={id} className="zx_lii">
                <img src={item.cover} onClick={this.shuju.bind(this,item.id)} className="zx_ph"/>
                <h1>{item.name}</h1>
            <hr/>
             <p>{item.artistName}
             </p></li>))}
                            </ul>      
                        </div>
               </div>
            )
    }
}
export default Paihang